#encoding: utf-8
from .logs.amanLogs import Logger
import config

def collectLogs(loginfo='未设置loginfo', lever='info', logger='notDefined', loglever=1):
    newLogger = Logger(logname=config.logFilePath, logger=logger, loglevel=loglever)
    myLogger = newLogger.getlog()
    lever = lever.lower()
    if lever == 'warning':
        collectLog = myLogger.warning(str(loginfo))
    elif lever == 'error':
        collectLog = myLogger.error(str(loginfo))
    else:
        collectLog = myLogger.info(str(loginfo))
    newLogger.rmHandler()
    return collectLog










